package com.dsbj.icardservice.utils;

import com.dsbj.icardservice.webserviceclient.dsbjpmc.JWSService;
import com.dsbj.icardservice.webserviceclient.dsbjpmc.JWSServiceImplService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ConfigurationProperties
@Configuration
public class PropertyUtil {

    private static String dsbjWsdl;

    private static String imageFileRoot;

    private static String imageUrlRoot;

    private static String oaDocUploaderName;
    private static String oaDocUploaderPassword;

    private static Integer oaDocUploadMaincategory;
    private static Integer oaDocUploadSubcategory;
    private static Integer oaDocUploadSeccategory;

    private static String workflowId;
    private static String workflowName;

    private static String oawsdl;

    private static String docwsdl;

    private static String hrmwsdl;


    @Bean
    public JWSService getJWSServiceImplPort(){
        JWSServiceImplService jwsServiceImpl = new JWSServiceImplService();
        JWSService jwsService = jwsServiceImpl.getJWSServiceImplPort();
        return jwsService;
    }

    public static String getDsbjWsdl() {
        return dsbjWsdl;
    }

    @Value("${dsbjpmc.wsdl}")
    public void setDsbjWsdl(String dsbjWsdl) {
        PropertyUtil.dsbjWsdl = dsbjWsdl;
    }

    public static String getImageFileRoot() {
        return imageFileRoot;
    }

    @Value("${image.fileroot}")
    public void setImageFileRoot(String imageFileRoot) {
        PropertyUtil.imageFileRoot = imageFileRoot;
    }

    public static String getImageUrlRoot() {
        return imageUrlRoot;
    }

    @Value("${image.urlroot}")
    public void setImageUrlRoot(String imageUrlRoot) {
        PropertyUtil.imageUrlRoot = imageUrlRoot;
    }

    public static String getOaDocUploaderName() {
        return oaDocUploaderName;
    }

    @Value("${ecology.doc.upload-username}")
    public  void setOaDocUploaderName(String oaDocUploaderName) {
        PropertyUtil.oaDocUploaderName = oaDocUploaderName;
    }

    public static String getOaDocUploaderPassword() {
        return oaDocUploaderPassword;
    }

    @Value("${ecology.doc.upload-password}")
    public  void setOaDocUploaderPassword(String oaDocUploaderPassword) {
        PropertyUtil.oaDocUploaderPassword = oaDocUploaderPassword;
    }

    public static Integer getOaDocUploadMaincategory() {
        return oaDocUploadMaincategory;
    }

    @Value("${ecology.doc.main-category}")
    public  void setOaDocUploadMaincategory(Integer oaDocUploadMaincategory) {
        PropertyUtil.oaDocUploadMaincategory = oaDocUploadMaincategory;
    }

    public static Integer getOaDocUploadSubcategory() {
        return oaDocUploadSubcategory;
    }

    @Value("${ecology.doc.sub-category}")
    public  void setOaDocUploadSubcategory(Integer oaDocUploadSubcategory) {
        PropertyUtil.oaDocUploadSubcategory = oaDocUploadSubcategory;
    }

    public static Integer getOaDocUploadSeccategory() {
        return oaDocUploadSeccategory;
    }

    @Value("${ecology.doc.sec-category}")
    public  void setOaDocUploadSeccategory(Integer oaDocUploadSeccategory) {
        PropertyUtil.oaDocUploadSeccategory = oaDocUploadSeccategory;
    }

    public static String getWorkflowId() {
        return workflowId;
    }

    @Value("${ecology.workflow.workflowId}")
    public  void setWorkflowId(String workflowId) {
        PropertyUtil.workflowId = workflowId;
    }

    public static String getWorkflowName() {
        return workflowName;
    }

    @Value("${ecology.workflow.workflowName}")
    public  void setWorkflowName(String workflowName) {
        PropertyUtil.workflowName = workflowName;
    }

    public static String getOawsdl() {
        return oawsdl;
    }

    @Value("${ecology.oawsdl}")
    public void setOawsdl(String oawsdl) {
        PropertyUtil.oawsdl = oawsdl;
    }

    public static String getDocwsdl() {
        return docwsdl;
    }

    @Value("${ecology.docwsdl}")
    public  void setDocwsdl(String docwsdl) {
        PropertyUtil.docwsdl = docwsdl;
    }

    public static String getHrmwsdl() {
        return hrmwsdl;
    }

    @Value("${ecology.hrmwsdl}")
    public  void setHrmwsdl(String hrmwsdl) {
        PropertyUtil.hrmwsdl = hrmwsdl;
    }
}
